package com.zhaogang.transactionManagerDemo.web;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class HelloController {

	@ResponseBody
	@RequestMapping("hello")
	public Object sayHello(String name) {
		Person person = new Person();
		person.setName(name);
		person.setLocation("WH");
		return person;
	}
	
	@RequestMapping("index")
	public String index(String name) {
		return "index";
	}

	class Person {
		private String name;
		private String location;

		public String getName() {
			return name;
		}

		public void setName(String name) {
			this.name = name;
		}

		public String getLocation() {
			return location;
		}

		public void setLocation(String location) {
			this.location = location;
		}
	}
}
